/**
 * @Date: 2022-03-08 11:57:43
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-03-08 12:00:59
 * @FilePath: \zhihuReal\db\db.js
 * @Description: something
 */
// @ts-nocheck
const mongoose = require('mongoose')
const {
    connectionStr
} = require('../config')

mongoose.connect(connectionStr, {
    useNewUrlParser: true,
    useUnifiedTopology: true
})
mongoose.connect(connectionStr, () => {
    console.log('数据库连接成功');
})
const conn = mongoose.connection
conn.on('error', err => {
    console.log(err.message);
})
// 连接测试
// conn.once('open', () => {
//     console.log('ok');
// })
module.exports = mongoose